package com.youxuit.youxu.kecheng.threadLocal.usage1;

import java.text.SimpleDateFormat;

/**
 * 日期转换工具类
 */
public class DateFormatUsage01 {

    public static void main(String[] args) {
        for (int i = 0; i < 1000; i++) {

            int finalI = i;
            new Thread(new Runnable() {
            @Override
            public void run() {
                String date = new DateFormatUsage01().formatDate(finalI);
                System.out.println(date);
            }
        }).start();
        }

    }

    public String formatDate(long times) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd mm:hh:ss");
        return dateFormat.format(times * 1000);
    }
}
